# Replication Package: Demographics and the Real Exchange Rate: Global Evidence Beyond the OECD

**Paper 22 in the Demographics & Global Capital Allocation series**
**Brian Peters, March 2026**

---

## Overview

This paper tests whether aging affects the real effective exchange rate globally. Key finding: aging depreciates the REER (Z₁ = -1.24***, survives two-way FE), reversing the OECD-only appreciation predicted by Groneck-Kaufmann. The non-tradable demand channel fails; working-age share is the leading candidate mechanism. Bootstrap p = 0.014; 99/99 LOO significant.

## Software Requirements

- Python 3.10+
- Required packages: `numpy`, `pandas`, `statsmodels`, `scipy`, `matplotlib`, `python-docx`
- Install: `pip install numpy pandas statsmodels scipy matplotlib python-docx`

## Directory Structure

```
replication/
  REPLICATION_README.md
  scripts/
    phase1_data_assembly.py      # Data assembly (merges REER, demographics, controls)
    phase2_baseline.py           # Baseline REER regressions
    phase3_mechanisms.py         # Mechanism tests (non-tradable, labor supply)
    phase4_groneck_replication.py # Groneck-Kaufmann OECD replication
    phase5_bulletproof.py        # Extended robustness battery
    phase6_referee_fixes.py      # Referee-requested robustness
    build_docx.py                # DOCX generation
  src/
    model.py                     # PanelGLS estimator (shared across series)
    [other shared modules]
  data/
    processed/
      rer_panel.csv              # Processed panel (REER, demographics, controls)
    raw/
      wdi_lfp.csv                # WDI labor force participation data
  output/tables/
    [25 markdown tables]         # All regression output
  paper/
    paper.md                     # Manuscript source
```

## Reproduction

Run scripts in order:
```bash
python3 scripts/phase1_data_assembly.py
python3 scripts/phase2_baseline.py
python3 scripts/phase3_mechanisms.py
python3 scripts/phase4_groneck_replication.py
python3 scripts/phase5_bulletproof.py
python3 scripts/phase6_referee_fixes.py
```

**Note:** Scripts use absolute paths (`/mnt/c/demographics_capital_flows/...`). Update the path references at the top of each script for your local environment.

## Data Sources

- UN World Population Prospects (2024 Revision) — age distributions
- IMF IFS — real effective exchange rate indices
- World Bank WDI — labor force participation, non-tradable share
- IMF WEO — fiscal balance, GDP growth
- Penn World Table 10.01 — output per worker
- Chinn-Ito KAOPEN — capital account openness
- Lane-Milesi-Ferretti — net foreign assets
